package com.jasonzqshen.ifm.mvc.models;

import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.RoundedRectangle;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.editparts.AbstractGraphicalEditPart;

import com.jasonzqshen.ifm.featureModelCore.*;
import com.jasonzqshen.ifm.featureModelCore.featureModelInterface.*;

public class FeatureNodeEditPart extends AbstractGraphicalEditPart {

    private Feature featureNode;

    private RoundedRectangle rectangle;

    /**
     * Constructor FeatureNodeEditPart
     * 
     * @param featureNode
     */
    public FeatureNodeEditPart(Feature featureNode) {
        this.featureNode = featureNode;

        // figure
        rectangle = new RoundedRectangle();
        rectangle.setSize(FeatureModel.DEFAULT_FEATURE_WIDTH,
                FeatureModel.DEFAULT_FEATURE_HEIGHT);
        rectangle.setLocation(new Point(1000, 10));
    }

    /**
     * Create figure
     */
    @Override
    protected IFigure createFigure() {
        return rectangle;
    }

    @Override
    protected void createEditPolicies() {
        // TODO Auto-generated method stub

    }

    /**
     * Get feature node
     */
    @Override
    public Object getModel() {
        return this.featureNode;
    }

}
